package com.yh.service.impl;

import com.yh.entity.ProductOrder;
import com.yh.mapper.OrderMapper;
import com.yh.service.IOrderService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * @author yh
 */
@Service
@AllArgsConstructor
public class OrderServiceImpl implements IOrderService {
    private final OrderMapper orderMapper;
    @Override
    public ProductOrder genOrder(Long proId, Long skuId, Integer nums, BigDecimal money, Integer status) {
        ProductOrder order = new ProductOrder();
        order.setMoney(money);
        order.setProductId(proId);
        order.setNums(nums);
        order.setStatus(status);
        order.setSkuId(skuId);
        orderMapper.insert(order);
        int i = 1/0;
        return order;
    }
}
